#!/usr/bin/env python
import sys
import rospy
from moveit_msgs.srv import SaveMap

filename = sys.argv[1]

rospy.init_node("save_map", anonymous=True)

save_map_service = rospy.ServiceProxy("move_group/save_map", SaveMap)
if save_map_service(filename):
    rospy.loginfo("Succeeded")
else:
    rospy.loginfo("Failed")
